import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import pinia from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//@ts-expect-error  忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
//暗黑模式
import 'element-plus/theme-chalk/dark/css-vars.css'
//引入自定义插件对象:注册整个项目全局组件
import gloalComponent from '@/components'
import { setupHighlight } from '@/plugins/highlight-init'
// 引入vform3表单设计器
import VForm3 from '@/lib/vform/designer.umd.js';
import '@/lib/vform/designer.style.css';

const app = createApp(App)
setupHighlight(app)

app.use(gloalComponent)
app.use(router)
app.use(pinia)
app.use(ElementPlus, {
  locale: zhCn,
})
// 注册vform3表单设计器
app.use(VForm3)
//自定义按钮权限
import { hasGranted } from '@/directive/permission.ts'
hasGranted(app)

app.mount('#app')
